/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

/**
 *
 * @author user
 */
public class bai7 {
    public static void main(String[] args) {
        int n=3;
        System.out.println(tongLT(n));
    }
    
    private static double tongLT(int n)
    {
        if(n==1) return 1;
        return Math.pow(n, n)+tongLT(n-1);
    }
}
